<template>
  <div class="mainSchedule">
    <van-nav-bar
      title="赛事安排"
      left-text=""
      left-arrow
      @click-left="onClickLeft"
    />
    <el-carousel :interval="5000" arrow="always" class="carousel">
      <el-carousel-item v-for="(i, index) in imgList" :key="index">
        <img v-bind:src="i" class="image" />
      </el-carousel-item>
    </el-carousel>
    <div class="sportTime">
      <el-timeline>
        <el-timeline-item timestamp="2021/6/18" placement="top">
          <el-card>
            <h4>羽毛球比赛</h4>
            <p>张三 vs 李四</p>
          </el-card>
        </el-timeline-item>
        <el-timeline-item timestamp="2021/6/20" placement="top">
          <el-card>
            <h4>乒乓球比赛</h4>
            <p>张三 vs 李四</p>
          </el-card>
        </el-timeline-item>
        <el-timeline-item timestamp="2021/7/5" placement="top">
          <el-card>
            <h4>乒乓球比赛</h4>
            <p>张三 vs 李四</p>
          </el-card>
        </el-timeline-item>
      </el-timeline>
    </div>
  </div>
</template>

<script>
export default {
  name: "SportSchedule",
  components: {},
  data() {
    return {
      backAddr: "/community",
      title: "赛事安排",
      imgList: [
        require("../assets/sport/1.jpeg"),
        require("../assets/sport/2.jpeg"),
        require("../assets/sport/3.jpg"),
        require("../assets/sport/4.jpeg"),
      ],
    };
  },
  methods: {
    onClickLeft() {
      this.$router.push({ path: this.backAddr });
    },
  },
};
</script>
<style lang="scss">
.mainSchedule {
  width: 375px;
  margin: 0;
}
.carousel {
  height: 250px;
}
.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}
.sportTime {
  margin: 20px 15px 0px 15px;
}
.image {
  height: 250px;
  width: 100%;
}
.van-nav-bar {
  background-color: #64b587;

  .van-nav-bar__title {
    color: white;
    font-weight: bold;
  }
  .van-icon {
    color: white;
  }
}
</style>